package me.timlong;

import java.util.ArrayList;

public class Cover2_nDimMatrix {

    public int RectCover(int target) {

        if(target == 0)
            return 0;

        ArrayList<Integer> ls = new ArrayList<>();
        ls.add(0, 1);
        ls.add(1, 1);
        for(int i = 2; i <= target; i++)
            ls.add(i, ls.get(i - 1) + ls.get(i - 2));

        return ls.get(target);
    }

    public static void main(String[] args) {
        System.out.println(new Cover2_nDimMatrix().RectCover(4));
    }
}
